import { Entity, Column, JoinColumn, OneToOne, PrimaryColumn } from "typeorm";
import { BblAttach } from "./attach.entity";

@Entity("BBL_HOME_BANNER")
export class BblHomeBanner {
  @PrimaryColumn({
    name: "HOME_BANNER_ID",
    type: "varchar",
    length: 50,
    comment: "首页图片ID"
  })
  bannerId: string;

  @OneToOne((type) => BblAttach, { createForeignKeyConstraints: false })
  @JoinColumn({
    name: "ATTACH_ID",
    referencedColumnName: "attId"
  })
  bannerImg: BblAttach;

  @Column({
    name: "HOME_BANNER_INDEX",
    type: "int",
    nullable: false,
    comment: "首页图片顺序"
  })
  bannerIndex: number;
}
